package com.example.nongye.http.api;

import android.os.Parcel;
import android.os.Parcelable;

import com.hjq.http.config.IRequestApi;

import java.io.Serializable;


public class BillListApi implements IRequestApi {
    @Override
    public String getApi() {
        return "/finance/turnover/page";
    }

    /**
     * yyyy-MM-dd
     */
    private String endDate;

    /**
     * 分页，默认为1
     */
    private int page;
    /**
     * yyyy-MM-dd
     */
    private String startDate;
    /**
     * //1:农行 2:哈尔滨银行 3:华安证券
     */
    private int type;

    /**
     * 默认为空，非空按照月份分组
     */
    private int groupMonthMark;

    public BillListApi(int page, String startDate, String endDate, int type) {
        this.page = page;
        this.startDate = startDate;
        this.endDate = endDate;
        this.type = type;
    }


    public final static class Response implements Serializable, Parcelable {

        private String item;
        private String transactionChannel;
        private Double amount;

        private Double balance;

        private String createDate;

        private String week;

        private String otherAccount;

        private String otherAccountName;

        private String otherAccountBank;

        private String tradingInstitutions;

        private String remark;

        private String securitiesName;

        private String securitiesCode;

        private Double dealPrice;

        private String dealNum;

        private String shareholderCode;

        public String getItem() {
            return item;
        }

        public void setItem(String item) {
            this.item = item;
        }

        public String getTransactionChannel() {
            return transactionChannel;
        }

        public void setTransactionChannel(String transactionChannel) {
            this.transactionChannel = transactionChannel;
        }

        public Double getAmount() {
            return amount;
        }

        public void setAmount(Double amount) {
            this.amount = amount;
        }

        public Double getBalance() {
            return balance;
        }

        public void setBalance(Double balance) {
            this.balance = balance;
        }

        public String getCreateDate() {
            return createDate;
        }

        public void setCreateDate(String createDate) {
            this.createDate = createDate;
        }

        public String getWeek() {
            return week;
        }

        public void setWeek(String week) {
            this.week = week;
        }

        public String getOtherAccount() {
            return otherAccount;
        }

        public void setOtherAccount(String otherAccount) {
            this.otherAccount = otherAccount;
        }

        public String getOtherAccountName() {
            return otherAccountName;
        }

        public void setOtherAccountName(String otherAccountName) {
            this.otherAccountName = otherAccountName;
        }

        public String getOtherAccountBank() {
            return otherAccountBank;
        }

        public void setOtherAccountBank(String otherAccountBank) {
            this.otherAccountBank = otherAccountBank;
        }

        public String getTradingInstitutions() {
            return tradingInstitutions;
        }

        public void setTradingInstitutions(String tradingInstitutions) {
            this.tradingInstitutions = tradingInstitutions;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }

        public String getSecuritiesName() {
            return securitiesName;
        }

        public void setSecuritiesName(String securitiesName) {
            this.securitiesName = securitiesName;
        }

        public String getSecuritiesCode() {
            return securitiesCode;
        }

        public void setSecuritiesCode(String securitiesCode) {
            this.securitiesCode = securitiesCode;
        }

        public Double getDealPrice() {
            return dealPrice;
        }

        public void setDealPrice(Double dealPrice) {
            this.dealPrice = dealPrice;
        }

        public String getDealNum() {
            return dealNum;
        }

        public void setDealNum(String dealNum) {
            this.dealNum = dealNum;
        }

        public String getShareholderCode() {
            return shareholderCode;
        }

        public void setShareholderCode(String shareholderCode) {
            this.shareholderCode = shareholderCode;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.item);
            dest.writeString(this.transactionChannel);
            dest.writeValue(this.amount);
            dest.writeValue(this.balance);
            dest.writeString(this.createDate);
            dest.writeString(this.week);
            dest.writeString(this.otherAccount);
            dest.writeString(this.otherAccountName);
            dest.writeString(this.otherAccountBank);
            dest.writeString(this.tradingInstitutions);
            dest.writeString(this.remark);
            dest.writeString(this.securitiesName);
            dest.writeString(this.securitiesCode);
            dest.writeValue(this.dealPrice);
            dest.writeString(this.dealNum);
            dest.writeString(this.shareholderCode);
        }

        public void readFromParcel(Parcel source) {
            this.item = source.readString();
            this.transactionChannel = source.readString();
            this.amount = (Double) source.readValue(Double.class.getClassLoader());
            this.balance = (Double) source.readValue(Double.class.getClassLoader());
            this.createDate = source.readString();
            this.week = source.readString();
            this.otherAccount = source.readString();
            this.otherAccountName = source.readString();
            this.otherAccountBank = source.readString();
            this.tradingInstitutions = source.readString();
            this.remark = source.readString();
            this.securitiesName = source.readString();
            this.securitiesCode = source.readString();
            this.dealPrice = (Double) source.readValue(Double.class.getClassLoader());
            this.dealNum = source.readString();
            this.shareholderCode = source.readString();
        }

        public Response() {
        }

        protected Response(Parcel in) {
            this.item = in.readString();
            this.transactionChannel = in.readString();
            this.amount = (Double) in.readValue(Double.class.getClassLoader());
            this.balance = (Double) in.readValue(Double.class.getClassLoader());
            this.createDate = in.readString();
            this.week = in.readString();
            this.otherAccount = in.readString();
            this.otherAccountName = in.readString();
            this.otherAccountBank = in.readString();
            this.tradingInstitutions = in.readString();
            this.remark = in.readString();
            this.securitiesName = in.readString();
            this.securitiesCode = in.readString();
            this.dealPrice = (Double) in.readValue(Double.class.getClassLoader());
            this.dealNum = in.readString();
            this.shareholderCode = in.readString();
        }

        public static final Creator<Response> CREATOR = new Creator<Response>() {
            @Override
            public Response createFromParcel(Parcel source) {
                return new Response(source);
            }

            @Override
            public Response[] newArray(int size) {
                return new Response[size];
            }
        };
    }
}
